	<table class="box-table-a">
	<thead>
	<tr>
	<th scope='col' style='width:70%'>Missing templates</th>
	<th scope='col'>Action</th>
	</tr>
	</thead>
	<tbody>
	<?php
	if (!empty($message))
	{
		echo "<tr><td colspan='2'>".$message."</td></tr>";
	};
	if (!empty($missingtemplates))
	{
	foreach($missingtemplates as $missing)
	{
		echo "<tr>";
		echo "<td>".$missing."</td>";
			echo "<td>";
			echo '<button id="bu_'.$missing.'" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"><span class="ui-button-text">Generate template</span></button>';
			echo "</td>";
			$this->Js->get("#bu_".$missing);
			$this->Js->event('click',
			$this->Js->request(
			array('controller' => 'updater','action'=>'createtemplate'),
			array(
			'type'=>'json',
			'method'=>'post',
			'update' => '#tableMissing',
			'data'=> '{name:"'.$missing.'"}',
			'dataExpression' => false,
			'error'=>'alert("An unexpected error has occurred!");'							
			)));
		echo "</tr>";
	}
	}
	?>
	</tbody>
	</table>
		
<?php echo $this->Js->writeBuffer(); ?>